package net.asgarli.ivault.api;

import java.util.ArrayList;
import java.util.List;

/**
 * Value object for iVault Container. 
 * 
 * @author Elchin Asgarli
 * @version 0.1
 * @since 0.1
 */
public class Container {

	/** 'Magic number' of container file */
	public static final char[] TYPE_CODE = {'E','A','I','V'};
	
	/** Version information of the Container. */
	private VersionInfo containerVersion = null;
	
	/** Authentication method of container. 
	 * Together with method, also contains all the data necessary to authenticate. */
	private KeySupplyMethod keySupplyMethod = null;
	
	/** Encryption method of container. */
	private EncryptionMethod encryptionMethod = null;
	
	/** The type of the content*/
	private ContentType contentType = null;
	
	/** The version of the content*/
	private VersionInfo contentVersion = null;
	
	/** The byte array representing the content*/
	private List<Byte> content = new ArrayList<Byte>();
	
	/** SHA-256 (as of version 0.1) checksum of the container */
	private byte[] checksum = null;

	
	/* Simple generated getters and setters. Exceptions are documented. */
	/**
	 * @return the containerVersion
	 */
	public VersionInfo getContainerVersion() {
		return containerVersion;
	}
	/**
	 * @param containerVersion the containerVersion to set
	 */
	public void setContainerVersion(VersionInfo containerVersion) {
		this.containerVersion = containerVersion;
	}
	/**
	 * @return the encryptionMethod
	 */
	public EncryptionMethod getEncryptionMethod() {
		return encryptionMethod;
	}
	/**
	 * @param encryptionMethod the encryptionMethod to set
	 */
	public void setEncryptionMethod(EncryptionMethod encryptionMethod) {
		this.encryptionMethod = encryptionMethod;
	}
	/**
	 * @return the keySupplyMethod
	 */
	public KeySupplyMethod getAuthenticationMethod() {
		return keySupplyMethod;
	}
	/**
	 * @param keySupplyMethod the keySupplyMethod to set
	 */
	public void setAuthenticationMethod(KeySupplyMethod keySupplyMethod) {
		this.keySupplyMethod = keySupplyMethod;
	}
	/**
	 * @return the contentType
	 */
	public ContentType getContentType() {
		return contentType;
	}
	/**
	 * @param contentType the contentType to set
	 */
	public void setContentType(ContentType contentType) {
		this.contentType = contentType;
	}
	/**
	 * @return the contentVersion
	 */
	public VersionInfo getContentVersion() {
		return contentVersion;
	}
	/**
	 * @param contentVersion the contentVersion to set
	 */
	public void setContentVersion(VersionInfo contentVersion) {
		this.contentVersion = contentVersion;
	}
	/**
	 * @return the content
	 */
	public List<Byte> getContent() {
		return content;
	}
	/**
	 * @param content the content to set
	 */
	public void setContent(List<Byte> content) {
		this.content = content;
	}
	/**
	 * @return the checksum
	 */
	public byte[] getChecksum() {
		return checksum;
	}
	/**
	 * @param checksum the checksum to set
	 */
	public void setChecksum(byte[] checksum) {
		this.checksum = checksum;
	}
}
